<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>视频播放</title>
	<link href="css/video-js.css" rel="stylesheet">
	<style>
		body{background-color: #191919}
		.m{ width: 740px; height: 400px; margin-left: auto; margin-right: auto; margin-top: 100px; }
	</style>
</head>

<body>
	<div class="m">
		<video id="my-video" class="video-js" controls preload="auto" width="740" height="400"
			   poster="image/m.png" data-setup="{}">
			<!--http://192.168.159.131:8888/group1/M00/00/00/wKifg1o6JLuAWBkUACTxRU3DbjI118.mp-->
			<source src="" type="video/mp4" id="source">
			<p class="vjs-no-js">
			  To view this video please enable JavaScript, and consider upgrading to a web browser that
			  <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
			</p>
		  </video>
		  <script src="js/video.min.js" type="text/javascript"></script>
		  <script src="js/jquery.min.js" type="text/javascript"></script>
		  <script type="text/javascript">

            var obj =  GetRequest();
			$("#source").attr("src", obj.url);
            $("#source").attr("type", "video/"+obj.type);
            var myPlayer = videojs('my-video');
			videojs("my-video").ready(function(){
				var myPlayer = this;
				myPlayer.play();
			});


            function GetRequest() {

                var url = location.search; //获取url中"?"符后的字串
                var theRequest = new Object();
                if (url.indexOf("?") != -1) {
                    var str = url.substr(1);
                    strs = str.split("&");
                    for(var i = 0; i < strs.length; i ++) {
                        theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
                    }
                }
                return theRequest;
            }
		</script>
	</div>

</body>
</html>
